counter = {}
for ch in "programming":
    if ch not in counter.keys():
        counter[ch] = 1
    else:
        counter[ch]+=1
print(counter)